﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace huaguwang.virtualWeb.uc.book
{
    public partial class book_class : System.Web.UI.UserControl
    {
        private readonly D_T_Category_Exp dalClass = new D_T_Category_Exp();
        private readonly D_T_EBook_Exp dalEBook = new D_T_EBook_Exp();
        private readonly D_T_RealBook_Exp dalRBook = new D_T_RealBook_Exp();
        //private List<M_Page> m_Dt = new List<M_Page>();
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                var dt = dalEBook.GetClassAll(0);
                Repeater1.DataSource = dt;
                Repeater1.DataBind();
            }
        }

        protected void Repeater1_ItemDataBound(object sender, RepeaterItemEventArgs e)
        {
            var p = (e.Item.FindControl("Repeater2") as Repeater);
            var model = (e.Item.DataItem as M_Page);
            var tempDt = dalEBook.GetClassAll(model.id.Exp_IntTryParse());
            p.DataSource = tempDt;
            p.DataBind();
        }
    }
}